﻿<MRow Justify="@JustifyTypes.Center">
    <MButton Class="white--text"
             Color="teal"
             OnClick="()=>_overlay = !_overlay">
        Show Overlay
    </MButton>

    <MOverlay ZIndex="_zIndex"
              Value="_overlay">
        <MButton Class="white--text"
                 Color="teal"
                 OnClick="()=>_overlay = false">
            Hide Overlay
        </MButton>
    </MOverlay>
</MRow>

@code {
    private bool _overlay = false;
    private int _zIndex = 0;
}